package cn.roisrosy.middleware.db.router;

/***
 * 数据源上下文
 */
public class DBContextHolder {
    private static  final  ThreadLocal<String> dbKey= new ThreadLocal<>();
    private static  final  ThreadLocal<String> tbKey = new ThreadLocal<>();

    public static  void setDbKey(String dbKeyIdX){
        dbKey.set(dbKeyIdX);
    }

    public  static  String getDbKey(){
        return dbKey.get();
    }
    public static  void setTbKey(String tbKeyIdX){
        tbKey.set(tbKeyIdX);
    }
    public  static  String getTbKey(){
        return tbKey.get();
    }
    public static  void clearDBKey(){
        dbKey.remove();
    }
    public static  void clearTBKey(){
        tbKey.remove();
    }



}
